package sakila.dto.film;

import java.util.Date;

/**
 * The Class BaseDTO.
 */
public abstract class BaseDTO
{

	/** The identify of object. */
	private int id;

	/** The name of object. */
	private String name;

	/** The time that the object was created or most recently updated. */
	private Date lastUpdate;

	/**
	 * Instantiates a new base dto.
	 */
	protected BaseDTO()
	{
	}

	/**
	 * Instantiates a new base dto.
	 * 
	 * @param id the id
	 * @param name the name
	 * @param lastUpdate the last update
	 */
	protected BaseDTO(int id, String name, Date lastUpdate)
	{
		this.id = id;
		this.name = name;
		this.lastUpdate = lastUpdate;
	}

	/**
	 * Gets the identify.
	 * 
	 * @return the id
	 */
	public int getId()
	{
		return this.id;
	}

	/**
	 * Gets the last update.
	 * 
	 * @return the last update
	 */
	public Date getLastUpdate()
	{
		return this.lastUpdate;
	}

	/**
	 * Gets the name.
	 * 
	 * @return the name
	 */
	protected String getName()
	{
		return this.name;
	}

	/**
	 * (@Inheritance doc).
	 * 
	 * @return the int
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode()
	{
		return this.id + this.name.hashCode();
	}

	/**
	 * Sets the identify.
	 * 
	 * @param id the id to set
	 */
	public void setId(int id)
	{
		this.id = id;
	}

	/**
	 * Sets the last update.
	 * 
	 * @param lastUpdate the new last update
	 */
	public void setLastUpdate(Date lastUpdate)
	{
		this.lastUpdate = lastUpdate;
	}

	/**
	 * Sets the name.
	 * 
	 * @param name the name to set
	 */
	protected void setName(String name)
	{
		this.name = name;
	}
}
